using UnityEngine;
using System.Collections;

public class StateVampDie : State<VampiroControl>
{
	static StateVampDie m_instance = new StateVampDie();
    public static StateVampDie instance { get { return m_instance; } }

	 public override void OnEnter(VampiroControl behaviour)
    {
// PROBLEMA: hay que mandar el mensaje a todas las torretas que esten atacando
		foreach(Transform tr in behaviour.listaEnemigosAtacantes) {
		 	//tr.SendMessage("EnemigoMuerto", behaviour.transform);
			TorretaControl tc = tr.GetComponent("TorretaControl") as TorretaControl;
			tc.EnemigoMuerto(behaviour.transform);
		}    
		behaviour.Destruir();
    }

    public override void OnUpdate(VampiroControl behaviour)
    {
    }

    public override void OnExit(VampiroControl behaviour)
    {
       
    }

    public override void OnAction(string name, VampiroControl behaviour, object value)
    {
        
    }

}
